<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
/**
 * @var Mage_Page_Block_Html_Header $this
 */
?>

<div class="header">
<div class="wrapper-head clearfix">
    <div class="head-left">

        <div class="logo">
            <a href="<?php echo $this->getUrl("") ?>">
                <img alt="<?php echo $this->getLogoAlt() ?>"
                     src="<?php echo $this->getLogoSrc() ?>"
                     title="<?php echo $this->getLogoAlt() ?>"/>
            </a>
        </div>
    </div>
    <div class="head-right">
        <div class="link-top">
            <ul class="links">

                <?php if ($this->helper('customer')->isLoggedIn()): ?>
                    <li><a href="<?php echo $this->getUrl('customer/account/logout') ?>"><?php echo $this->__('Sign Out') ?> </a></li>
                    <li>
                        <a href="<?php echo $this->getUrl('customer/account/edit') ?>"><?php echo $this->__('My Account') ?> </a> &nbsp;|&nbsp;
                        <a href="<?php echo $this->getUrl('sales/order/history') ?>"><?php echo $this->__('Order History') ?> </a>
                    </li>
                    
                <?php else: ?>
<!--                    <li><a href="<?php echo $this->getUrl('customer/account/login') ?>"><?php echo $this->__('Sign in') ?> </a></li>-->
                        <li>
                            <a href="<?php echo $this->getUrl('customer/account/login') ?>"><?php echo $this->__('Sign in') ?> </a> /
                            <a href="<?php echo $this->getUrl('customer/account/login') ?>"><?php echo $this->__('Resgister Now') ?></a>
                        </li>
                <?php endif; ?>

                        <li><a href="<?php echo $this->getUrl("home/index/catalog")?>"><?php echo $this->__("Catalog") ?> </a></li>
                        <li >
                            <a class="cart" href="<?php echo $this->getUrl('checkout/cart') ?>"><?php echo $this->__('Cart Contains: %d Items', Mage::helper('checkout/cart')->getItemsCount()) ?> </a>
                        </li>

            </ul>
        </div>
        <?php $link = $this->getRequest()->getParam("link"); ?>
        <div class="nav-container clear">
            <ul class="nav">
                <?php if($link=="home"): ?>
                <li><a class="active" href="<?php echo $this->getUrl("") ?>?link=home"><?php echo $this->__("HOME") ?></a></li>
                <?php else:?>
                <li><a href="<?php echo $this->getUrl("") ?>?link=home"><?php echo $this->__("HOME") ?></a></li>
                <?php endif;?>
                <?php
                    $blockType = Mage::getBlockSingleton("home/home");
                    $category = $blockType->getDefaultCategory();
                ?>
                <?php if($link=="product"): ?>
                    <li><a class="active" href="<?php echo $category->getUrl() ?>?link=product"><?php echo $this->__("PRODUCTS") ?></a></li>
                <?php else:?>
                    <li><a href="<?php echo $category->getUrl() ?>?link=product"><?php echo $this->__("PRODUCTS") ?></a></li>
                <?php endif;?>
                <?php $file = Mage::getStoreConfig('home/general/fileoffer'); ?>
                <?php $title = Mage::getStoreConfig('home/general/title'); ?>

                <?php if($link=="about"): ?>
                              
                    <li class="">
                        
                        <a class="active" href="<?php echo $this->getUrl("about-us")?>?link=about">
   
                            <?php echo $this->__("ABOUT US") ?>
                        </a>
                    </li>
                    
                 <?php else:?>

                    <li class="">
                
                        <a href="<?php echo $this->getUrl("about-us")?>">

                            <?php echo $this->__("ABOUT US") ?>
                        </a>
                    </li>
                 <?php endif;?>
                <?php if($link=="customer"): ?>
                    <li><a class="active" href="<?php echo $this->getUrl('customer-care') ?>?link=customer"><?php echo $this->__("CUSTOMER CARE") ?></a></li>
                <?php else:?>
                    <li><a href="<?php echo $this->getUrl('customer-care') ?>?link=customer"><?php echo $this->__("CUSTOMER CARE") ?></a></li>
                <?php endif;?>
            </ul>
    <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('home_contact')->toHtml(); ?>

        </div><!--end nav-container-->
        <div class="box-search">

            <?php echo $this->getChildHtml('topSearch') ?>

            <div class="search-adv">
                
                <?php $moduleName = $this->getRequest()->getModuleName(); ?>
                <?php if($moduleName !== "catalogsearch"): ?>
                    <a href="<?php echo $this->getUrl("catalogsearch/result")."?q=1" ?>" class="search-advanced"><?php echo $this->__("Advanced Search") ?></a>
                <?php endif;?>        
                <a class="build" href="<?php echo $this->getUrl("home/order/build") ?>"><?php echo $this->__("BUILD YOUR ORDER") ?></a>
            </div>
        </div>
    </div><!--end head-right-->
</div>
</div><!--end header-->



